#ifndef __SENSOR_H
#define __SENSOR_H

#include "../utils/nocopyable.h"
#include <stdint.h>

namespace driver {

class Sensor : public utils::NoCopyable {

public:
    void init();

    uint16_t flow_count() const;
    void flow_reset();
    uint16_t flow_volume() const;

    void read_temp();

    bool is_water_level_high() const;
    bool is_water_level_low() const;
    bool is_go_switch() const;
    bool is_leak1() const;
    bool is_leak2() const;
    bool is_bowl_checked() const;
    
    uint16_t kpa() const;
    

    bool is_temp_all_ok() { return m_water_temp_ok && m_steam_temp_ok; }

    uint32_t water_temp() { return m_water_temp; }
    uint32_t steam_temp() { return m_steam_temp; }

    int16_t water_temp_value() { return m_water_temp_value; }
    int16_t steam_temp_value() { return m_steam_temp_value; }

private:
    bool m_steam_temp_ok = false;
    bool m_water_temp_ok = false;
    uint32_t m_water_temp = 0;
    uint32_t m_steam_temp = 0;
    int16_t m_steam_temp_value = 0;
    int16_t m_water_temp_value = 0;
};

extern Sensor sensor;

} // namespace driver

#endif
